

import java.io.InputStream;
import java.io.OutputStream;
import java.util.Comparator;
import java.util.Set;
import java.util.TreeSet;

import javax.lang.model.SourceVersion;
import javax.tools.Tool;
class My{
    int a;
    My(int s){
        this.a=s;
    }

}
class Mycompare implements Comparator<My> {
    @Override
    public int compare(My s1, My s2) {
        return s1.a - s2.a;
    }
}

public class CustomTreeSetDemo{
    public static void main(String[] args) {
        Set<My> treeSet = new TreeSet<>();
        treeSet.add(new My(3));
        treeSet.add(new My(5));
        treeSet.add(new My(90));
        treeSet.add(new My(56));
        treeSet.add(new My(-9));
        treeSet.add(new My(44));
        System.out.println(treeSet);
    }
}
